package cn.example.backstage.costmanagement.controller;

import cn.example.backstage.base.response.JsonResult;
import cn.example.backstage.costmanagement.pojo.dto.PurchaseRecordsQuery;
import cn.example.backstage.costmanagement.pojo.vo.PurchaseRecordsVO;
import cn.example.backstage.costmanagement.service.CostManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@Api(tags = "门诊消费")
@RequestMapping("/v1/CostManagementController")
public class CostManagementController {

    @Autowired
    private CostManagementService costManagementService;

    @ApiOperation(value = "查询门诊消费记录")
    @GetMapping("select/outpatientConsumption")

    public JsonResult outpatientConsumption(PurchaseRecordsQuery purchaseRecordsQuery){
        log.debug("门诊消费记录:{}",purchaseRecordsQuery);
        List<PurchaseRecordsVO> list = costManagementService.selectOutpatientConsumption(purchaseRecordsQuery);
        return JsonResult.ok(list);
    }


}
